package com.idc.quotation.utils;
import java.security.SecureRandom;

public class ComplexRandomKeyGenerator {

	private static final String CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
    private static final int KEY_LENGTH = 16;

    public static void main(String[] args) {
        String randomKey = generateRandomKey(KEY_LENGTH);
        System.out.println("Generated Complex Random Key: " + randomKey);
    }

    public static String generateRandomKey(int length) {
        SecureRandom random = new SecureRandom();
        StringBuilder key = new StringBuilder(length);

        for (int i = 0; i < length; i++) {
            int index = random.nextInt(CHARACTERS.length());
            key.append(CHARACTERS.charAt(index));
        }

        return key.toString();
    }
}
